/**
 * @filename:TransferService Dec 15, 2023
 * @project Wonder Vue Admin Api  1.1.0
 * Copyright(c) 2022 Wonder Co. Ltd. 
 * All right reserved. 
 */
package com.wonder.app.service;
import cn.hutool.json.JSONObject;
import com.vtuzx.core.bean.dto.VtuzxMap;
import com.wonder.app.domain.Transfer;
import com.wonder.app.request.TransferRequest;
import com.wonder.common.common.AjaxResult;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;
/**   
 * @Description:TODO(网页调拨服务层)
 * @version: 1.1.0
 * @author: Wonder
 * 
 */
public interface TransferService extends IService<Transfer> {

    
    /**
     * 验证网页调拨信息
     * 
     * @param transfer
     * @param type
     * @return 结果
     */
    public String validate(Transfer transfer,String type);   
   
	
	 /**
	 * Description:网页调拨分页返回
	 * @param request//检索条件
	 * @param page//分页参数
	 * @return IPage<Transfer>   //分页记录
	 */
    public IPage<Transfer> selectList(TransferRequest request, Page<Transfer> page);


	/**
	 * 获取调拨单详情
	 * @param map
	 * @return
	 */
	VtuzxMap getDetail(Map<String, Object> map);

	/**
	 * 根据编码和批次查询即时库存物料
	 * @param map
	 * @return
	 */
    Map<String, Object> getMaterialFromStock(Map<String, Object> map);

	/**
	 * 详情页修改后保存调拨单
	 * @param map
	 * @return
	 */
	VtuzxMap updateTransfer(String userName, Long user_id,Map<String, Object> map) throws Exception;

	/**
	 * 根据工业平板的实际重量生成调拨单
	 * @param map
	 * @return
	 */
    Boolean savePickMaterial(JSONObject map) throws Exception;

    boolean auditTransfer(String userName,Long user_id, String billNo ) throws Exception;

	/**
	 * 反审核调拨单
	 * @param userName
	 * @param user_id
	 * @param billNo
	 * @return
	 */
	boolean unAuditTransfer(String userName, Long user_id, String billNo) throws Exception;

	/**
	 * 中台创建调拨单
	 * @param userName
	 * @param user_id
	 * @param map
	 * @return
	 */
	VtuzxMap createTransferWeb(String userName, Long user_id, Map<String, Object> map);

	/**
	 * 获取当天的领料信息
	 * @param map
	 * @return
	 */
	Map<String, Object> getToadyTransfer(JSONObject map) throws Exception;

	/**
	 * 删除调拨单
	 * @return
	 */
	boolean removeTransfer(String billNo);

	/**
	 * 生成退料的调拨单
	 * @param map
	 * @return
	 */
	Boolean saveReturnTransfer(JSONObject map) throws Exception;

	/**
	 * 根据时间和车间获取调拨数量,以及对应岗上仓库剩余的数量
	 * @param map
	 * @return
	 * @throws Exception
	 */
	Map<String, Object> getTransferAndWorkshop(JSONObject map) throws Exception;
}
